//
//  UIBarButtonItem+Extension.swift
//  myWeibo
//
//  Created by 樊健荣 on 16/7/21.
//  Copyright © 2016年 樊健荣. All rights reserved.
//

import UIKit

//扩展UIBarButtonItem
extension UIBarButtonItem {
    
    convenience init(imageName: String) {
        
        let button: UIButton = UIButton(type: UIButtonType.Custom)
        button.setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        button.setImage(UIImage(named: imageName+"_highlighted"), forState: UIControlState.Highlighted)
        button.sizeToFit()
        self.init(customView: button)
    }
    
}